<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title></title>
		<link rel="stylesheet" href="css/pintuer.css">
		<link rel="stylesheet" href="css/admin.css">
		<script src="js/jquery.js"></script>
		<script src="js/pintuer.js"></script>
	</head>
	<body>
		<form method="post" action="" id="listform">
			<div class="panel admin-panel">
				<div class="panel-head"><strong class="icon-reorder"> 会员列表</strong> 
				 <center><font align="center" style="color:red;font-size:20px;">${flag2}</font></center>
				</div>
				<div class="padding border-bottom">
					
				</div>
				<table class="table table-hover text-center">
					<tr>
						<th width="100" style="text-align:left; padding-left:20px;">会员ID</th>
						<th width="10%">用户名</th>
						<th>用户密码</th>
						<th>用户邮箱</th>
						<th>用户手机号</th>
						<th width="310">操作</th>
					</tr>
						<c:forEach items="${PageInfo.list }" var="user">
						<tr>
							<td style="text-align:left; padding-left:20px;"><input type="checkbox" name="id[]" value="" />${user.uid}</td>
							<td><font style="width:50px; text-align:center"> ${user.loginname }</font></td>
							<td width="10%">${user.loginpass }</td>
							<td>${user.email }</td>
							<td>${user.phone }</td>
							<td>
								<div class="button-group">
								<!--  	<a class="button border-main" href="add.html"><span class="icon-edit"></span> 修改</a>-->
									<a class="button border-red" href="javascript:void(0)" onclick="return del(${user.uid},1,1)"><span class="icon-trash-o"></span>
										删除</a> </div>
							</td>
						</tr>
					</c:forEach>
						
							<td colspan="8">
								<div class="pagelist">
								<a href="showuser.do?pageNumber=${PageInfo.pageNumber-1 }&pageSize=${PageInfo.pageSize}" <c:if test="${PageInfo.pageNumber<=1 }">  onclick="javascript:return false;" </c:if> >上一页</a>
								<c:forEach var="i" begin="1" end="${PageInfo.total}">
									<input type="button" onclick="return tiaozhuan('${i}')" value="${i}">
									<!--<span class="current"> </span> -->
									<!-- <a href="showuser.do?pageNumber=${i}&pageSize=${PageInfo.pageSize}"><c:out value="${i}"/></a> -->
								</c:forEach>
								<a href="showuser.do?pageNumber=${PageInfo.pageNumber+1 }&pageSize=${PageInfo.pageSize}" <c:if test="${PageInfo.pageNumber>=PageInfo.total }">  onclick="javascript:return false;" </c:if> >下一页</a>
								
							</td>
						</tr>
				</table>
			</div>
		</form>
		<script type="text/javascript">
			//跳转到不同页数
			function tiaozhuan(i) {
				location.href = "showuser.do?pageNumber="+i+"&pageSize=${PageInfo.pageSize}";
			}

			//单个删除
			function del(id, mid, iscid) {
				if (confirm("您确定要删除吗?")) {
					//alert("updateuser?oper=1&uid="+id);
					location.href = "updateuser.do?oper=1&uid="+id;

				}
			}

			//全选
			$("#checkall").click(function() {
				$("input[name='id[]']").each(function() {
					if (this.checked) {
						this.checked = false;
					} else {
						this.checked = true;
					}
				});
			})

			//批量删除
			function DelSelect() {
				var Checkbox = false;
				$("input[name='id[]']").each(function() {
					if (this.checked == true) {
						Checkbox = true;
					}
				});
				if (Checkbox) {
					var t = confirm("您确认要删除选中的内容吗？");
					if (t == false) return false;
					$("#listform").submit();
				} else {
					alert("请选择您要删除的内容!");
					return false;
				}
			}

			//批量排序
			function sorts() {
				var Checkbox = false;
				$("input[name='id[]']").each(function() {
					if (this.checked == true) {
						Checkbox = true;
					}
				});
				if (Checkbox) {

					$("#listform").submit();
				} else {
					alert("请选择要操作的内容!");
					return false;
				}
			}


			//批量首页显示
			function changeishome(o) {
				var Checkbox = false;
				$("input[name='id[]']").each(function() {
					if (this.checked == true) {
						Checkbox = true;
					}
				});
				if (Checkbox) {

					$("#listform").submit();
				} else {
					alert("请选择要操作的内容!");

					return false;
				}
			}

			//批量推荐
			function changeisvouch(o) {
				var Checkbox = false;
				$("input[name='id[]']").each(function() {
					if (this.checked == true) {
						Checkbox = true;
					}
				});
				if (Checkbox) {


					$("#listform").submit();
				} else {
					alert("请选择要操作的内容!");

					return false;
				}
			}

			//批量置顶
			function changeistop(o) {
				var Checkbox = false;
				$("input[name='id[]']").each(function() {
					if (this.checked == true) {
						Checkbox = true;
					}
				});
				if (Checkbox) {

					$("#listform").submit();
				} else {
					alert("请选择要操作的内容!");

					return false;
				}
			}


			//批量移动
			function changecate(o) {
				var Checkbox = false;
				$("input[name='id[]']").each(function() {
					if (this.checked == true) {
						Checkbox = true;
					}
				});
				if (Checkbox) {

					$("#listform").submit();
				} else {
					alert("请选择要操作的内容!");

					return false;
				}
			}

			//批量复制
			function changecopy(o) {
				var Checkbox = false;
				$("input[name='id[]']").each(function() {
					if (this.checked == true) {
						Checkbox = true;
					}
				});
				if (Checkbox) {
					var i = 0;
					$("input[name='id[]']").each(function() {
						if (this.checked == true) {
							i++;
						}
					});
					if (i > 1) {
						alert("只能选择一条信息!");
						$(o).find("option:first").prop("selected", "selected");
					} else {

						$("#listform").submit();
					}
				} else {
					alert("请选择要复制的内容!");
					$(o).find("option:first").prop("selected", "selected");
					return false;
				}
			}
		</script>
	</body>
</html>
